<script>
    // ● 打印1-100之间所有的数
    for (let i = 1; i <= 100; i++) {
        console.log(i);
    }
    console.log('................................')


    // ● 打印 10-100 之间的偶数
    for (let j = 10; j <= 100; j++) {
        if (j % 2 == 0) {
            console.log(j);
        }
    }
    console.log('................................')


    // ● 打印1-100之间所有数的和
    let total1 = 0;
    for (let k = 1; k <= 100; k++) {
        total1 += k;
    }
    console.log("1-100的和为:" + total1);
    console.log('................................')


    // ● 打印1-100之间所有偶数的和
    let total2 = 0;
    for (let k = 1; k <= 100; k++) {
        if (k % 2 == 0) {
            total2 += k;
        }
    }
    console.log("1-100偶数的和为:" + total2);
    console.log('................................')


    // ● 打印出 2000-4000之间的闰年
    for (let years = 2000; years <= 4000; years++) {
        if (years % 4 == 0 && (years % 100 != 0)) {
            console.log("2000-4000间的闰年有:" + years);
        }
    }
    console.log('................................')


    // 闰年条件：能被4整除且不能被100整除的年份 或者 能被400整除的年份
    for (let years = 2000; years <= 4000; years++) {
        if ((years % 4 == 0 && years % 100 != 0) || years % 400 == 0) {
            console.log("能被4除(不能被100除或能被400除)的闰年有:" + years);
        }
    }
    console.log('................................')


    // ● 打印出 100-200之间能够被3整除或4整除的数
    for (let h = 100; h <= 200; h++) {
        if (h % 3 == 0 && h % 4 == 0) {
            console.log("100-200能被3或4除的有:" + h)
        }
    }

</script>